home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 22 / PC Actual CD 22.iso / SHARE / prog / POVRAY / FRYANEGG.ZIP / HOUSE-2.INC < prev    next >
Encoding:
Text File  |  1996-08-31  |  12.7 KB  |  369 lines

  1.  
  2. //------------------------------------------------------------------->
  3. //------------------------------------------------------------------->
  4. //
  5. // "house-2.inc" - Create the second (left side) house.
  6. //
  7. // Created by: Paul T. Dawson
  8. //             ptdawson@voicenet.com
  9. //             http://www.voicenet.com/~ptdawson
  10. //
  11. // Note: This is the house on the left. It's even sloppier than the
  12. //       house on the right! Most of the pieces are copied from house-1,
  13. //       which was [obviously] done first.
  14.  
  15. //------------------------------------------------------------------->
  16. //------------------------------------------------------------------->
  17. //
  18. // Set up the colors.
  19.  
  20.         #declare Trim_Pigment = pigment { MediumSeaGreen }
  21.         #declare Siding_Pigment = pigment { Goldenrod }
  22.  
  23. //------------------------------------------------------------------->
  24. //------------------------------------------------------------------->
  25. //
  26. // Front siding.
  27.  
  28.         #declare Front_Siding = difference{
  29.  
  30.                 union {
  31.                 #declare A = 0
  32.                 #while ( A < 9*12 )
  33.                         box { < 0, -5, -1 > < 36*12, 5, 1 >
  34.                                 rotate x*10
  35.                                 translate y * (A+12) }
  36.                 #declare A=A+8
  37.                 #end
  38.                 } // End of union.
  39.  
  40.                 // Move the windows and doors around.
  41.                 //  4- 8 window
  42.                 // 12-17 door
  43.                 // 22-26 window
  44.                 // 28-32 window
  45.  
  46.                 // Cutouts for medium size windows.
  47.                 box { <  4*12, 2*12, -10 > <  8*12, 8*12, 10 > }
  48.                 box { < 22*12, 2*12, -10 > < 26*12, 8*12, 10 > }
  49.                 box { < 28*12, 2*12, -10 > < 32*12, 8*12, 10 > }
  50.  
  51.                 // Cutout for door.
  52.                 box { < 12*12, 1*12, -10 > < 17*12, 8*12, 10 > }
  53.  
  54.                 pigment { Siding_Pigment }
  55.                 normal { bumps 0.2 scale 1 }
  56.  
  57.                 } // End of difference.
  58.  
  59. //------------------------------------------------------------------->
  60. //------------------------------------------------------------------->
  61. //
  62. // Right side siding. This starts out *too tall*, then everything
  63. // outside the /\ part is differenced off.
  64.  
  65.         #declare Right_Side_Siding = difference {
  66.  
  67.                 union {
  68.  
  69.                 #declare A = 0
  70.                 #while ( A < 16*12 )
  71.  
  72.                         box { < 0, -5, -1 > < 24*12, 5, 1 >
  73.                                 rotate x*10
  74.                                 translate y * (A+12) }
  75.  
  76.                 #declare A=A+8
  77.                 #end
  78.  
  79.                 } // End of union.
  80.  
  81.                 // Cutouts for medium size windows.
  82.                 box { <   4*12, 2*12, -10 > <   8*12, 8*12, 10 > }
  83.                 box { <  12*12, 2*12, -10 > <  16*12, 8*12, 10 > }
  84.  
  85.                 // Slicer thingies.
  86.                 box { < -50, 0, -5 > < 300, 100, 5 >
  87.                         rotate z * -30
  88.                         translate <12*12, 17*12,0 > }
  89.  
  90.                 box { <-300, 0, -5 > < 50, 100, 5 >
  91.                         rotate z * 30
  92.                         translate <12*12, 17*12,0 > }
  93.  
  94.                 // Now spin it all, and move it over.
  95.                         rotate y * -90
  96.                         translate x * 36*12
  97.  
  98.                 pigment { Siding_Pigment }
  99.                 normal { bumps 0.2 scale 1 }
  100.  
  101.                 } // End of difference.
  102.  
  103. //------------------------------------------------------------------->
  104. //------------------------------------------------------------------->
  105. //
  106. // Very simple back and left side walls. These are white, because
  107. // all you see is the interior side. Sloppy!
  108.  
  109.         #declare Fake_Walls = union {
  110.  
  111.                 box { < 0, 12, 3 > < 1, 9*12, 24*12 > }
  112.  
  113.                 box { < 0, 12, 24*12 > < 36*12, 9*12, (24*12)-1 > }
  114.  
  115.                 pigment { White }
  116.  
  117.                 } // End of union.
  118.  
  119. //------------------------------------------------------------------->
  120. //------------------------------------------------------------------->
  121. //
  122. // Medium size windows - fill up 48x72 rough openings.
  123.  
  124.         #declare Medium_Window = union {
  125.  
  126.                 difference{
  127.                 box { < 0, 0, -6 > < 48, 72, 6 > }
  128.                 box { < 6, 6, -7 > < 42, 66, 7 > }
  129.  
  130.                         } // End of difference.
  131.  
  132.                 // Horizontal dividers.
  133.                         #declare A = 16
  134.                         #while ( A <= 56 )
  135.                         box{ < 0, A-0.5, -1 > < 48, A+0.5, 1 > }
  136.                         #declare A = A + 10
  137.                         #end
  138.  
  139.                 // Extra thick center one!
  140.                         box{ < 0, (36)-1.5, -2 > < 48, (36)+1.5, 2 > }
  141.  
  142.                 // Vertical dividers.
  143.                         #declare A = 15
  144.                         #while (A <= 33 )
  145.                         box{ < A-0.5, 0, -1 > < A+0.5, 72, 1 > }
  146.                         #declare A=A+9
  147.                         #end
  148.  
  149.                 pigment { Trim_Pigment }
  150.  
  151.         } // End of union.
  152.  
  153. //------------------------------------------------------------------->
  154. //------------------------------------------------------------------->
  155. //
  156. // Curtains for medium windows.
  157.  
  158.         #declare The_Curtains =
  159.  
  160.                 mesh {
  161.  
  162.                 // Top part.
  163.                 triangle{ <0,72,7><28,72,7><0,0,7> }
  164.                 triangle{ <20,72,7><48,72,7><48,0,7> }
  165.  
  166.                 // Bottom part.
  167.                 triangle{ <0,0,7><0,24,7><24,0,7> }
  168.                 triangle{ <48,0,7><48,24,7><24,0,7> }
  169.  
  170.                 pigment { color rgb < 0.6, 0.6, 1.0 > }
  171.  
  172.                 } // End of mesh
  173.  
  174. //------------------------------------------------------------------->
  175. //------------------------------------------------------------------->
  176. //
  177. // The front door - fill up 60x84 rough opening.
  178.  
  179.         #declare Front_Door = union {
  180.  
  181.                 difference{
  182.  
  183.                         box { < 0, 0, -6 > < 60, 84, 6 > }
  184.                         box { < 6, 1, -7 > < 54, 78, 7 > }
  185.  
  186.                         pigment { Trim_Pigment }
  187.  
  188.                         } // End of difference.
  189.  
  190.                 // Wood door.
  191.                         box { < 0, 0, 5 > < 60, 84, 6 >
  192.                                 pigment { brick GreenCopper, Blue
  193.                                         scale < 0.5, 200, 200 > }
  194.                                 normal { bumps 0.5 scale 0.2 } }
  195.  
  196.                 // Door knob.
  197.                         sphere{0,2 scale <1,1,0.5> translate < 9,36,4 >
  198.                                 texture { T_Gold_3C } }
  199.  
  200.                 } // End of union.
  201.  
  202. //------------------------------------------------------------------->
  203. //------------------------------------------------------------------->
  204. //
  205. // Trim boards (at front corners of house).
  206.  
  207.         #declare Trim_Boards = union {
  208.  
  209.                 box { < -2, 6, -2 > < 4, 9.5*12, 4 > }
  210.  
  211.                 box { < (36*12)-4, 9, -2 > < (36*12)+2, 9.5*12, 4 > }
  212.  
  213.                 pigment { Trim_Pigment }
  214.  
  215.                 } // End of union.
  216.  
  217. //------------------------------------------------------------------->
  218. //------------------------------------------------------------------->
  219. //
  220. // Brick foundation
  221.  
  222.         #declare Brick_Foundation =
  223.  
  224.                 box { < 1, 0, 1 > < (36*12)-1, 12, (24*12)-1 >
  225.                         pigment { brick Gray30, Firebrick } }
  226.  
  227. //------------------------------------------------------------------->
  228. //------------------------------------------------------------------->
  229. //
  230. // Front steps - one foot past door.
  231.  
  232.         #declare Front_Steps = union {
  233.  
  234.                 box { < 15*12, 0, 1 > < 22*12,  6, -4.5*12 > }
  235.                 box { < 15*12, 6, 1 > < 22*12, 12, -4.0*12 > }
  236.  
  237.                 pigment { brick Gray30, Firebrick }
  238.  
  239.         } // End of union.
  240.  
  241. //------------------------------------------------------------------->
  242. //------------------------------------------------------------------->
  243. //
  244. // Hand rails for front steps.
  245.  
  246.         #declare Hand_Rails = union {
  247.  
  248.         cylinder { < 15.5*12, 4*12, -2*12 > < 15.5*12, 4*12, 1*12 >, 1.5 }
  249.         cylinder { < 21.5*12, 4*12, -2*12 > < 21.5*12, 4*12, 1*12 >, 1.5 }
  250.  
  251.         #declare A = -3.5 #while ( A <= -0.5 )
  252.  
  253.         cylinder { < 15.5*12, 0, A*12 > < 15.5*12, 4*12, A*12 >, 1.5 }
  254.         cylinder { < 21.5*12, 0, A*12 > < 21.5*12, 4*12, A*12 >, 1.5 }
  255.  
  256.         #declare A = A + 0.5 #end
  257.  
  258.         pigment { SteelBlue }
  259.  
  260.         } // End of union.
  261.  
  262. //------------------------------------------------------------------->
  263. //------------------------------------------------------------------->
  264. //
  265. // Bright white floor.
  266.  
  267.         #declare White_Floor =
  268.                 box { < 3, 12, 3 > < (36*12)-3, 12.1, (24*12)-3 >
  269.                 pigment { White } }
  270.  
  271. //------------------------------------------------------------------->
  272. //------------------------------------------------------------------->
  273. //
  274. // The roof (not very accurate, but it looks semi-ok).
  275.  
  276.         #declare Roof = union {
  277.  
  278.                 // Front part (all shingles).
  279.                 // Rotate this *after* texture is applied.
  280.                 box { < -12, -24, 0 > < 37*12, 15*12, -6 >
  281.                         texture { brick 
  282.                                 texture { pigment { Gray20 } },
  283.                                 texture { T_Wood35 }
  284.                                 brick_size < 36, 12, 12 >
  285.                                 mortar 0.5
  286.                         } // End of texture.
  287.                         rotate x * 90 }
  288.  
  289.                 // Trim on front and right edge. This fits just a little
  290.                 // bit under the shingles.
  291.                         box { < -12.1, 0, -24.1 > < 37.1*12, 5, 14.9*12 >
  292.                         pigment { Trim_Pigment } }
  293.  
  294.                 // Back part (just the right edge is visible). Paint it
  295.                 // with the trim color, because you're really looking
  296.                 // at the bottom, not the shingles!
  297.                         box { < 34*12, 0, 0 > < 37*12, 6, 15*12 >
  298.                         rotate x * 60 translate z * 12*15
  299.                         pigment { Trim_Pigment } }
  300.  
  301.                 // Adjust the entire roof.
  302.                         rotate x * -30
  303.                         translate y * 10*12
  304.  
  305.                 } // End of union.
  306.  
  307. //------------------------------------------------------------------->
  308. //------------------------------------------------------------------->
  309. //
  310. // How about a nice big chimney!?!
  311.  
  312.         #declare The_Chimney = union {
  313.  
  314.                 box { < -2*12, 0, 9*12 > < 0, 20*12, 15*12 >
  315.                         pigment { brick Gray30, Firebrick } }
  316.  
  317.                 box { < (-2*12)-2, 20*12,     ( 9*12)-2 >
  318.                         < 2,       (20*12)+2, (15*12)+2 >
  319.                         pigment { Gray30 } }
  320.  
  321.                 } // End of union.
  322.  
  323. //------------------------------------------------------------------->
  324. //------------------------------------------------------------------->
  325. //
  326. // Put everything together.
  327.  
  328.         #declare House_Two = union {
  329.  
  330.                 object { The_Chimney }
  331.                 object { Front_Siding }
  332.                 object { Right_Side_Siding }
  333.                 object { Fake_Walls }
  334.                 object { Brick_Foundation }
  335.                 object { Trim_Boards }
  336.  
  337.                 object { Front_Steps translate x * (-4*12) }
  338.                 object { Hand_Rails  translate x * (-4*12) }
  339.  
  340.                 object { White_Floor }
  341.                 object { Roof }
  342.  
  343.                 object { Medium_Window translate<  4*12, 2*12, 4> }
  344.                 object { Medium_Window translate< 22*12, 2*12, 4> }
  345.                 object { Medium_Window translate< 28*12, 2*12, 4> }
  346.                 object { The_Curtains  translate<  4*12, 2*12, 4> }
  347.                 object { The_Curtains  translate< 22*12, 2*12, 4> }
  348.                 object { The_Curtains  translate< 28*12, 2*12, 4> }
  349.  
  350.                 // Side windows
  351.                 object { Medium_Window rotate y * -90
  352.                         translate<  (36*12)-4, 2*12, 4*12> }
  353.                 object { Medium_Window rotate y * -90
  354.                         translate<  (36*12)-4, 2*12, 12*12> }
  355.                 object { The_Curtains  rotate y * -90
  356.                         translate< (36*12)-4, 2*12, 4*12> }
  357.                 object { The_Curtains  rotate y * -90
  358.                         translate< (36*12)-4, 2*12, 12*12> }
  359.  
  360.                 object { Front_Door translate < 12*12, 1*12, 0 > }
  361.  
  362.         } // End of union.
  363.  
  364. //------------------------------------------------------------------->
  365. //------------------------------------------------------------------->
  366. //
  367. // End of this file.
  368.  
  369.